package thefirst.code.model;

import java.sql.SQLException;
import java.util.List;

import javax.annotation.Resource;

import org.mybatis.spring.SqlSessionTemplate;
import org.springframework.stereotype.Repository;
@Repository
public class CodeDaoImpl implements CodeDao {
	
	@Resource(name="sqlSessionTemplate")
	private SqlSessionTemplate sqlSessionTemplate;
	
	@Override
	public List<CodeVO> findGenderByCode() throws SQLException {
		return this.sqlSessionTemplate.selectList("code.findGenderByCode");
	}
	/**
	 * 코드마스터에서 code_type이 동일한 항목만 리스트로 가져온다.
	 */
	@Override
	public List<CodeVO> getCodeList(String code_type) throws SQLException {
		return this.sqlSessionTemplate.selectList("code.getCodeList", code_type);
	}
	
}
